package com.ymttest.database.mongo.bean;

import java.util.Date;

import com.google.gson.annotations.SerializedName;
import com.ymttest.utils.YMTDateUtil;

public class GsonCompatibleDate {
    @SerializedName("$date")
    public String date;

    public GsonCompatibleDate(String date) {
        this.date = YMTDateUtil.getFromISODate(date);
    }

    public Date getDate() {
        return YMTDateUtil.getDate(date, YMTDateUtil.YMDHMS);
    }

    public void setDate(String date) {
        this.date = date;
    }
}
